package yunhe.biz;

import java.sql.Date;
import java.util.List;
import java.util.Map;

import yunhe.entity.EmpMsg;
import yunhe.entity.Product;
import yunhe.entity.Purchase;
import yunhe.entity.PurchaseAppend;
import yunhe.entity.PurchasePack;
import yunhe.entity.Storage;
import yunhe.entity.Supplier;

public interface IProcureBiz {
	/**
	 * 合同创建
	 * @param purchasePack
	 * @return
	 */
	boolean insertPurchasePack(PurchasePack purchasePack);
	/**
	 * 通过产品编码查询合同
	 * @param product
	 * @return
	 */
	PurchasePack selectPurchasePackByProduct(Product product);
	/**
	 * 进货单的创建
	 * @param purchase
	 * @return
	 */
	boolean insertPurchase(Purchase purchase);
	/**
	 * 通过供货商和日期查询进货单
	 * @param supplier
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	List<Purchase> selectPurchaseBySupplier(Supplier supplier,String startDate,String endDate);
	/**
	 * 一段时间内有关该供货商的采购单一共有多少条
	 * @param supplier
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	int selectPurchaseBySupplierDate(Supplier supplier,String startDate,String endDate);
	/**
	 * 通过日期查询进货单
	 * @param startDate
	 * @param endDate
	 * @param pageSize
	 * @param currPage
	 * @return
	 */
	List<Purchase> selectPurchaseByPurchaseDate(String startDate,String endDate,int pageSize,int currPage);
	/**
	 * 创建采购单
	 * @param purchaseAppend
	 * @return
	 */
	boolean insertPurchaseAppend(PurchaseAppend purchaseAppend);
	/**
	 * 根据产品分页查询采购单
	 * @param pageSize
	 * @param currPage
	 * @param product
	 * @return
	 */
	List<PurchaseAppend> selectPurchaseAppendByProduct(int pageSize,int currPage,Product product);
	/**
	 * 根据采购单查询进货单
	 * @param purchase
	 * @return
	 */
	Purchase selectPurchaseByPurchaseAppend(PurchaseAppend purchaseAppend);
	/**
	 * 根据进货单查询采购单
	 * @param purchase
	 * @return
	 */
	PurchaseAppend selectPurchaseAppendByPurchase(Purchase purchase);
	/**
	 * 添加产品
	 * @param product
	 * @return
	 */
	boolean insertProduct(Product product);
	/**
	 * 根据供货商部分信息获取供货商详细信息
	 * @param supplier
	 * @return
	 */
	Supplier selectSupplierBySupplier(Supplier supplier);
	/**
	 * 根据用户名查询用户详细信息
	 * @param empMsg
	 * @return
	 */
	EmpMsg selectEmpMsgByEmpMsgName(EmpMsg empMsg);
	/**
	 * 根据产品编号查询产品信息
	 * @param product
	 * @return
	 */
	Product getByProBarCode(Product product);
	/**
	 * 根据仓库名查询仓库详细信息
	 * @param storage
	 * @return
	 */
	Storage selectStorageByStorageName(Storage storage);
	/**
	 * 通过采购数量分页查询有效采购单
	 * @param pageSize
	 * @param currPage
	 * @return
	 */
	List<PurchaseAppend> selectPurchaseAppendByValidPurQuantity(int pageSize,int currPage);
	/**
	 * 查询有效购买的条数
	 */
	int selectValidPurQuantity();
	/**
	 * 通过采购数量分页查询退货单
	 * @param pageSize
	 * @param currPage
	 * @return
	 */
	List<PurchaseAppend> selectPurchaseAppendByInvalidPurQuantity(int pageSize,int currPage);
	/**
	 * 查询有效购买的条数
	 * @return
	 */
	int selectInvalidPurQuantity();
	/**
	 * 根据产品编号和日期分页查询采购单
	 * @param startDate
	 * @param endDate
	 * @param pageSize
	 * @param currPage
	 * @param proBarCode
	 * @return
	 */
	List<PurchaseAppend> selectPurchaseAppendByProductDate(String startDate,String endDate,Product product);
	/**
	 * 根据产品编号和日期查询共有多少条记录
	 * @param startDate
	 * @param endDate
	 * @param proBarCode
	 * @return
	 */
	int selectPurchaseAppendByProductDateCount(String startDate,String endDate,Product product);
	/**
	 * 根据供货商和日期分页查询详细采购单信息
	 * @param startDate
	 * @param endDate
	 * @param pageSize
	 * @param currPage
	 * @param supplier
	 * @return
	 */
	List<PurchaseAppend> selectPurchaseAppendBySupplierPagesDate(String startDate,String endDate,Supplier supplier);
	/**
	 * 根据供货商和日期查询共有多少条采购单
	 * @param startDate
	 * @param endDate
	 * @param supplier
	 * @return
	 */
	int selectPurchaseAppendBySupplierPagesCount(String startDate,String endDate,Supplier supplier);
	/**
	 * 分页查询所有采购单
	 * @param pageSize
	 * @param currPage
	 * @return
	 */
	List<PurchaseAppend> selectPurchaseAppendByPages(int pageSize,int currPage);
	/**
	 * 共有多少采购单
	 * @return
	 */
	int selectPurchaseAppendCount();
	/**
	 * 根据采购单编号删除采购单
	 * @param purId
	 * @return
	 */
	boolean deletePurchaseAndPurchaseAppendBypurId(String purId);
	/**
	 * 根据采购单编号查询采购单
	 * @param purId
	 * @return
	 */
	PurchaseAppend selectPurchaseAppendByPurchaseAppend(String purId);
	/**
	 * 按日期分页查询退货单
	 * @param startDate
	 * @param endDate
	 * @param pageSize
	 * @param currPage
	 * @return
	 */
	List<PurchaseAppend> selectInvalidPurchaseAppendByPagesAndDate(String startDate,String endDate);
	/**
	 * 按日期查询退货单有多少条
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	int selectInvalidPurchaseAppendByPagesAndDateCount(String startDate,String endDate);
	/**
	 * 按日期分页查询采购单
	 * @param startDate
	 * @param endDate
	 * @param pageSize
	 * @param currPage
	 * @return
	 */
	List<PurchaseAppend> selectValidPurchaseAppendByPagesAndDate(String startDate,String endDate);
	/**
	 * 按日期查询采购单有多少条
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	int selectValidPurchaseAppendByPagesAndDateCount(String startDate,String endDate);

	public List<PurchaseAppend> selectPurchaseAppend(String prusId);
}
